﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BackEnd.Models;
using BusinessLayer.RegInfo;
using BusinessLayer.RegInfo.Entities;
using BusinessLayer.RegInfo.Models;

namespace BackEnd.Controllers
{
    public class LoginLogController : Controller
    {
        //
        // GET: /LoginLog/

        public JsonResult Search(string email, DateTime? fromDate, DateTime? toDate, int? status, int pageIndex, int pageSize)
        {
            int totalRecord;
            List<LoginLogExtend> listAccount = new LoginLogBL().Search(email, fromDate, toDate, status, pageIndex, pageSize, out totalRecord);
            ListObjectModel<LoginLogExtend> listObject = new ListObjectModel<LoginLogExtend>
            {
                ListItem = listAccount,
                PageIndex = pageIndex,
                PageSize = pageSize,
                TotalRecord = totalRecord
            };
            return Json(listObject, JsonRequestBehavior.AllowGet);
        }

    }
}
